﻿Public Class uc_NumberPad
    Public strNum As String

    Private Sub btn_General_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_1.Click, btn_3.Click, btn_2.Click, btn_9.Click, btn_8.Click, btn_7.Click, btn_6.Click, btn_5.Click, btn_4.Click, btn_0.Click
        Dim b As Button = sender
        strNum = strNum + b.Text
    End Sub

    Public Custom Event NumberButtonClick As EventHandler
        AddHandler(ByVal value As EventHandler)
            AddHandler btn_0.Click, value
            AddHandler btn_1.Click, value
            AddHandler btn_2.Click, value
            AddHandler btn_3.Click, value
            AddHandler btn_4.Click, value
            AddHandler btn_5.Click, value
            AddHandler btn_6.Click, value
            AddHandler btn_7.Click, value
            AddHandler btn_8.Click, value
            AddHandler btn_9.Click, value
        End AddHandler

        RemoveHandler(ByVal value As EventHandler)

        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs)

        End RaiseEvent
    End Event

    Public Custom Event ClearButtonClick As EventHandler
        AddHandler(ByVal value As EventHandler)
            AddHandler btn_C.Click, value
        End AddHandler

        RemoveHandler(ByVal value As EventHandler)

        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs)

        End RaiseEvent
    End Event

    Public Custom Event OkButtonClick As EventHandler
        AddHandler(ByVal value As EventHandler)
            AddHandler btn_Ok.Click, value
        End AddHandler

        RemoveHandler(ByVal value As EventHandler)

        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As System.EventArgs)

        End RaiseEvent
    End Event

    Private Sub btn_C_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_C.Click
        strNum = ""
    End Sub
End Class
